0 REM FAMILY ROOTS: SEARCH PROGRAM. COPYRIGHT 1982, STEPHEN C. VORENBERG
20 GOTO 12000
100 GOSUB 2600
110 BB = W: FOR I = 0 TO Q(37) -1: IF PA(I) <W AND W < = CT(I) THEN W = W -PA(I) +Q(36) *I:I = Q(37)
120 NEXT :J = LEN(NA$(W)):K = 0:N1$ = "":N2$ = "":N3$ = "":N4$ = "": IF J = 0 THEN 330
130 FOR I = LEN(NA$(W)) TO 1 STEP -1: IF MID$ (NA$(W),I,1) < >Q$(5) THEN 310
140 K = K +1: IF I -J = 0 THEN 300
150 ON K GOTO 220,210,200
200 N1$ = MID$ (NA$(W),I +1,J -I): GOTO 300
210 N2$ = MID$ (NA$(W),I +1,J -I): GOTO 300
220 N4$ = RIGHT$(NA$(W),J -I)
300 J = I -1: IF K = 3 THEN I = 1
310 NEXT : IF J -I >0 THEN N3$ = LEFT$(NA$(W),J -I)
320 IF K = 2 THEN N1$ = N2$:N2$ = N3$:N3$ = ""
330 W = BB: RETURN
350 J = 0: IF NOT OP(3) THEN GOSUB 395: GOSUB 415: GOSUB 435: GOSUB 460: GOTO 380
355 IF OP(4) AND N3$ < >"" THEN 370
360 J = 1: GOSUB 415:J = 0: IF IX +2 < = FC THEN PRINT ", ";:IX = IX +2
365 GOSUB 395: GOSUB 460: GOTO 380
370 J = 1: GOSUB 435:J = 0: IF IX +2 < = FC THEN PRINT ", ";:IX = IX +2
375 GOSUB 395: GOSUB 415: GOSUB 460
380 IF OP(8) THEN IF IX + LEN( STR$(W)) +6 >FC THEN GOSUB 480
385 IF OP(8) THEN PRINT " (ID="W")";:IX = IX + LEN( STR$(W)) +6
390 RETURN
395 IF N1$ = "" THEN RETURN
400 IF IX + LEN(N1$) < = FC THEN 413
401 IF FC < = IX THEN 413
403 LA = 0: FOR K = FC -IX TO 1 STEP -1: IF MID$ (N1$,K,1) = " " OR MID$ (N1$,K,1) = ";" OR MID$ (N1$,K,1) = "." OR MID$ (N1$,K,1) = "-" THEN PRINT LEFT$(N1$,K);:A$ = RIGHT$(N1$, LEN(N1$) -K): GOSUB 480:K = 1:LA = 1
406 NEXT : IF LA >0 THEN GOSUB 480: GOTO 413
409 IF LEN(N1$) +IX >FC THEN 401
413 PRINT N1$;:IX = IX + LEN(N1$): RETURN
415 IF N2$ = "" THEN RETURN
418 IF IX + LEN(N2$) +1 >FC THEN GOSUB 480: GOTO 425
420 IF NOT J THEN PRINT " ";:IX = IX +1
425 PRINT N2$;:IX = IX + LEN(N2$)
430 RETURN
435 IF NOT OP(4) OR N3$ = "" THEN RETURN
440 IF IX + LEN(N3$) +1 >FC THEN GOSUB 480: GOTO 450
445 IF NOT J THEN PRINT " ";:IX = IX +1
450 PRINT N3$;:IX = IX + LEN(N3$)
455 RETURN
460 IF N4$ = "" THEN RETURN
465 IF IX + LEN(N4$) +1 >FC THEN GOSUB 480: GOTO 475
690 GET YN$: POKE -16368,0: NORMAL : PRINT YN$: IF ASC(YN$) >95 THEN YN$ = CHR$( ASC(YN$) -32)
695 RETURN
700 PRINT : PRINT "SEARCH RECORDS BY:": PRINT
705 L = H1 -1: IF LO >0 THEN L = H1
710 FOR X = 1 TO L: PRINT X") "H1$(X): NEXT
720 PRINT : INVERSE : PRINT "CHOICE (1-"L",P)?";: GOSUB 690: IF YN$ = CHR$(13) THEN RETURN
730 IF YN$ = "P" THEN GOSUB 9000: GOTO 700
740 C3 = VAL(YN$): IF C3 <1 OR C3 >L THEN 720
745 IF C3 < >H1 AND LO >0 THEN LO = 0: PRINT "LIST IN MEMORY CLEARED": FOR I = 0 TO Q(18): FOR J = 0 TO 1:S$(I,J +5) = S$(I,J +FL -1): NEXT : NEXT :FL = 6
1010 PRINT : FOR I = 1 TO L: PRINT I") "S$(I,0): NEXT : IF Q(44) <1 THEN 1020
1015 FOR I = 1 TO Q(44): PRINT I +L") "Q$(I +11): IF I +L = 17 THEN PRINT "TYPE ANY KEY TO CONTINUE";: GOSUB 690
1018 NEXT : IF Q(26) THEN PRINT L +Q(44) +1") AUTO DATE"
1020 PRINT : PRINT "SELECT UP TO "Q(42)" OF THESE BY NUMBER": PRINT
1030 INVERSE : PRINT TT$"NUMBER:";: NORMAL : INPUT " ";V1$
1040 IF V1$ = "" THEN 1100
1042 OG = VAL(V1$): IF OG <1 OR OG >L +Q(44) +K THEN 1005
1045 TT$ = "NEXT "
1050 M = M +1:OE(M) = OG: IF M <Q(42) THEN 1030
1100 IF M = 0 THEN RETURN
1110 PRINT : PRINT "YOU HAVE SELECTED:": PRINT : FOR I = 1 TO M: PRINT OE(I)") ";: IF OE(I) < = L THEN PRINT S$(OE(I),0): GOTO 1120
1115 IF OE(I) < = L +Q(44) THEN PRINT Q$(OE(I) -L +11): GOTO 1120
1118 PRINT "AUTO DATE"
1120 NEXT : PRINT : INVERSE : PRINT "OK TO CONTINUE? ";: GOSUB 690: IF YN$ = "N" THEN 1000
1130 IF C1 = 5 THEN EM$(1) = "":T = 1: GOTO 1260
1150 PRINT : PRINT "PICK UP TO "Q(42)" DIFFERENT EMBEDDED CHAR" CHR$((Q(43) = 0) *45) CHR$((Q(43) = 0) *13)"ACTER STRINGS TO SEARCH FOR IN THE": PRINT "ABOVE:"
1155 T = 0: IF Q(9) >0 THEN CALL G(0)
1165 TT$ = "FIRST ": PRINT
1170 INVERSE : PRINT TT$"STRING:";: NORMAL : INPUT " ";V1$
1180 IF V1$ = "" THEN 1220
1190 T = T +1:EM$(T) = V1$:TT$ = "NEXT ": IF T <Q(42) THEN 1170
1220 IF T < >0 THEN 1240
1230 PRINT "REALLY? ";: GOSUB 690: IF YN$ = "Y" THEN RETURN
1235 GOTO 1150
1240 PRINT : PRINT "SEARCH CHARACTER STRINGS WILL BE:": PRINT : FOR I = 1 TO T: PRINT I") '"EM$(I)"'": NEXT
1250 PRINT : INVERSE : PRINT "OK TO CONTINUE? ";: GOSUB 690: IF YN$ = "N" THEN 1150
1260 S$(0,FL) = S$(C1,2):S$(1,FL) = STR$(M): FOR I = 1 TO M: IF OE(I) <16 THEN S$(I +1,FL) = S$(OE(I),0): GOTO 1270
1265 IF OE(I) >15 AND OE(I) < = 15 +Q(44) THEN S$(I +1,FL) = Q$(OE(I) -4): GOTO 1270
1267 S$(I +1,FL) = "AUTO DATE"
1270 NEXT :FL = FL +1:S$(0,FL) = STR$(T): FOR I = 1 TO T:S$(I,FL) = EM$(I): NEXT
1350 GOSUB 700: RETURN
1500 FOR X5 = 1 TO T:T$ = EM$(X5): IF OP(7) THEN GOSUB 1800
1502 FOR X6 = 1 TO M: IF OE(X6) >15 +Q(44) THEN Z$ = RC$(11): GOTO 1520
1503 IF OE(X6) >15 THEN Z$ = RC$(OE(X6) -4): GOTO 1520
1504 IF OE(X6) >12 THEN Z$ = RC$(OE(X6) -5): GOTO 1520
1505 IF OE(X6) = 12 THEN 1700
1506 IF OE(X6) = 11 THEN 1650
1507 IF OE(X6) >6 THEN 1600
1508 IF OE(X6) >4 THEN Z$ = RC$(OE(X6) +1): GOTO 1520
1510 Z$ = RC$(OE(X6))
1520 IF C1 = 1 THEN 1524
1521 IF Z$ = T$ THEN FR = 1:X6 = M
1522 GOTO 1750
1524 IF LEN(T$) > LEN(Z$) THEN 1750
1525 IF OP(7) THEN GOSUB 1820
1530 FOR X7 = 1 TO LEN(Z$) - LEN(T$) +1
1540 IF MID$ (Z$,X7, LEN(T$)) = T$ THEN FR = 1:X7 = 1000
1550 NEXT : IF FR THEN X6 = M
1560 GOTO 1750
1600 IF MG = 0 THEN 1750
1605 FOR X7 = 1 TO MG:Z$ = MI$(OE(X6) -6,X7): IF C1 = 1 THEN 1608
1606 IF T$ = Z$ THEN FR = 1:X7 = MG
1607 GOTO 1640
1608 IF LEN(T$) > LEN(Z$) THEN 1640
1609 IF OP(7) THEN GOSUB 1820
1610 FOR X8 = 1 TO LEN(Z$) - LEN(T$) +1
1620 IF MID$ (Z$,X8, LEN(T$)) = T$ THEN FR = 1:X8 = 1000
1630 NEXT : IF FR THEN X7 = MG
1640 NEXT : IF FR THEN X6 = M
1645 GOTO 1750
1650 IF CN = 0 THEN 1750
1655 FOR X7 = 1 TO CN: IF C1 = 1 THEN 1658
1656 IF T$ = C$(X7) THEN FR = 1:X7 = CN
1657 GOTO 1680
1658 IF LEN(T$) > LEN(C$(X7)) THEN 1680
1659 Z$ = C$(X7): IF OP(7) THEN GOSUB 1820
1660 FOR X8 = 1 TO LEN(Z$) - LEN(T$) +1: IF MID$ (Z$,X8, LEN(T$)) = T$ THEN FR = 1:X8 = 1000
1670 NEXT : IF FR THEN X7 = CN
1680 NEXT : IF FR THEN X6 = M
1690 GOTO 1750
1700 IF NT = 0 THEN 1750
1705 FOR X7 = 1 TO NT:Z$ = EX$(X7): IF C1 = 1 THEN 1708
1706 IF T$ = Z$ THEN FR = 1:X7 = NT
1707 GOTO 1740
1708 IF LEN(T$) > LEN(Z$) THEN 1740
1709 IF OP(7) THEN GOSUB 1820
1710 FOR X8 = 1 TO LEN(Z$) - LEN(T$) +1
1720 IF MID$ (Z$,X8, LEN(T$)) = T$ THEN FR = 1:X8 = 1000
1730 NEXT : IF FR THEN X7 = NT
1740 NEXT : IF FR THEN X6 = M
1750 NEXT : IF FR THEN X5 = T
1760 NEXT : RETURN
1800 IF T$ = "" THEN RETURN
1802 A$ = T$:T$ = "": FOR I = 1 TO LEN(A$): IF ASC( MID$ (A$,I,1)) >95 THEN T$ = T$ + CHR$( ASC( MID$ (A$,I,1)) -32): GOTO 1810
1805 T$ = T$ + MID$ (A$,I,1)
1810 NEXT : RETURN
1820 IF Z$ = "" THEN RETURN
1825 A$ = Z$:Z$ = "": FOR I = 1 TO LEN(A$): IF ASC( MID$ (A$,I,1)) >95 THEN Z$ = Z$ + CHR$( ASC( MID$ (A$,I,1)) -32): GOTO 1835
1830 Z$ = Z$ + MID$ (A$,I,1)
1835 NEXT : RETURN
1900 IF AA$ = "" THEN 1945
1910 LB = 0: FOR I = LEN(AA$) TO 1 STEP -1: IF MID$ (AA$,I,1) = Q$(4) THEN LB = I:I = 1
1920 NEXT :FM$ = "": IF LB >0 THEN FM$ = RIGHT$(AA$, LEN(AA$) -LB +1)
1930 IF LB >1 THEN AA$ = LEFT$(AA$,LB -1)
1940 IF LB = 1 THEN AA$ = ""
1945 AA = VAL(AA$): RETURN
2000 W = X: GOSUB 2600
2010 IF LEN(NA$(X -PA(IP) +Q(36) *IP)) < = 3 THEN RETURN
2012 IF Q(43) = 0 OR Q(41) THEN VTAB 1
2015 HTAB 15: PRINT "SEARCHING ID="X: POKE 34,2
2020 GOSUB 4100
2030 FR = 0: ON C1 GOSUB 1500,3400,5500,8500,1500
2210 IF NOT FR AND (C3 = 2 OR C3 = 4) THEN SV(XZ) = 0
2215 IF NOT FR THEN RETURN
2220 IF Q(43) = 0 OR Q(41) THEN VTAB TB:TB = TB +1: IF TB >24 THEN TB = 24
2230 W = X: GOSUB 100
2232 IX = 0: GOSUB 350
2250 PRINT : IF LO <G(10) AND C3 < >2 AND C3 < >4 THEN LO = LO +1:SV(LO) = X
2260 RETURN
2300 IF LO <1 THEN 2380
2330 FOR I = 1 TO LO
2335 IF SV(I) < >0 THEN 2370
2340 IF LO = I THEN 2365
2345 FOR J = I +1 TO LO:SV(J -1) = SV(J): NEXT
2365 LO = LO -1: IF I < = LO THEN 2335
2370 NEXT : IF LO = 0 THEN PRINT "NONE FOUND": FOR I = 1 TO 5000: NEXT
2380 RETURN
2500 BB = 0: FOR I = 1 TO Q(8): IF WH(I,0) > -1 THEN IF W >WH(I,0) AND W < = WH(I,0) +G(2) THEN BB = I:I = Q(8)
2510 NEXT : IF BB >0 THEN RETURN
2515 FOR I = 1 TO Q(8): IF WH(I,0) <0 AND X1 < >I THEN BB = I:I = Q(8)
2517 NEXT : IF BB >0 THEN 2535
2520 A = -1: FOR I = 1 TO Q(8): IF WH(I,0) > -1 THEN IF A <WH(I,1) THEN A = WH(I,1):BB = I
2530 NEXT : IF BB <1 THEN BB = 1: IF BB = X1 THEN BB = 2
2535 IF JR THEN GOSUB 600:X2 = 1
2540 PRINT : PRINT "PLEASE PLACE DISKETTE NUMBER "; INT((W -1)/G(2)) +1: PRINT "INTO DRIVE "BB
2550 PRINT : PRINT "TYPE ANY KEY WHEN READY";: GOSUB 690: IF YN$ < >CZ$ AND YN$ < >"N" THEN 2560
2890 FOR I = Q(36) *IP +1 TO Q(36) *(IP +1): INPUT NA$(I): NEXT : PRINT CHR$(4)"CLOSE NAMELIST":SC(IP) = 0:PA(IP) = PA(IP) +WH(BB,0):CT(IP) = PA(IP) +Q(36): IF JR AND X2 THEN GOSUB 580
2895 RETURN
2900 POKE 216,0: CALL G(8): PRINT : PRINT "THAT WAS NOT A DATA DISKETTE.": PRINT "PLEASE TRY AGAIN...";: GET YN$: PRINT YN$: POKE -16368,0: PRINT CHR$(4)"OPEN CONTROLS": PRINT CHR$(4)"READ CONTROLS": RESUME
3000 GOSUB 850:L = VAL(CH$(0)):X9 = 1: GOSUB 3300
3010 PRINT "DO YOU WANT TO:"
3020 PRINT : FOR I = 1 TO L: PRINT I") "CH$(I): NEXT
3030 PRINT : INVERSE : PRINT "WHICH (1-"L")? ";: GOSUB 690: IF YN$ = CHR$(13) THEN RETURN
3040 C2 = VAL(YN$): IF C2 <1 OR C2 >L THEN 3030
3042 K = 0: IF Q(26) THEN K = 1
3045 L = VAL(S$(0,1)): IF C2 = 2 THEN PRINT : PRINT "CHOOSE 2 DATE VARIABLES:": PRINT : GOTO 3060
3050 PRINT : PRINT "CHOOSE UP TO "L +IQ +K" DATE VARIABLES:": PRINT
3060 FOR I = 1 TO L: PRINT I") "S$(I,1): NEXT : GOSUB 3350: IF Q(26) THEN PRINT L +IQ +1") AUTO DATE"
8500 FOR X5 = 1 TO T: IF RC$(OE(X5)) = "" THEN 8600
8510 AA$ = RC$(OE(X5)): GOSUB 1900:PB = AA: FOR X6 = 1 TO M: IF PB = OD(X6) THEN FR = 1:X6 = M:X5 = T
8520 NEXT
8600 NEXT : RETURN
9000 GOSUB 850: INVERSE : PRINT "SELECT PARAMETER BY LETTER:": NORMAL : PRINT
9010 FOR I = 1 TO OP: PRINT CHR$(64 +I)") "OP$(I)" (NOW "OP(I)")": IF INT(I/4) *4 = I THEN PRINT
9020 NEXT :J = OP: IF DY$ < >"" THEN J = J +1: PRINT CHR$(64 +J)") DATE (NOW "DY$")": PRINT
9030 PRINT "(NOTE: 0='FALSE',1='TRUE')"
9040 PRINT : INVERSE : PRINT "WHICH (A-" CHR$(64 +J)")?";: GOSUB 690: IF YN$ = CHR$(13) THEN RETURN
9090 A = ASC(YN$) -64: IF A <1 OR A >J THEN 9040
9100 IF J >OP AND A = J THEN 9140
9110 PRINT OP$(A)"?";: GET B$: POKE -16368,0: PRINT B$;
9120 IF A < >2 AND A < >5 THEN 9130
9122 GET YN$: POKE -16368,0: PRINT YN$;: IF YN$ = CHR$(13) THEN 9130
9124 IF YN$ < > CHR$(8) THEN B$ = B$ +YN$: GOTO 9122
9126 IF LEN(B$) >1 THEN B$ = LEFT$(B$, LEN(B$) -1): GOTO 9122
9128 B$ = "": GOTO 9122
9130 IF B$ = CHR$(13) OR B$ = "" THEN 9000
9135 OP(A) = VAL(B$): GOTO 9000
9140 INPUT "DATE?";B$: IF B$ < >"" THEN DY$ = B$
9150 GOTO 9000
9200 FOR I = 5 TO FL STEP 2: PRINT SPC( OP(5))S$(0,I)":";:M = VAL(S$(1,I)): IF I = 5 THEN PRINT SPC( 7)DY$;
9210 PRINT : FOR J = 1 TO M: PRINT SPC( OP(5) +3)S$(J +1,I): NEXT :LC = LC +M +1:T = VAL(S$(0,I +1))
9212 IF T = 1 AND S$(1,I +1) = "" THEN 9230
9215 PRINT : PRINT SPC( OP(5))"SEARCH FOR THE FOLLOWING VALUES:":LC = LC +2
9220 FOR J = 1 TO T: PRINT SPC( OP(5) +3)S$(J,I +1): NEXT :LC = LC +T
9230 PRINT :LC = LC +1: NEXT : PRINT SPC( OP(5))"RECORDS FOR THE FOLLOWING PEOPLE SATISFIED THE SEARCH:": PRINT :LC = LC +2: RETURN
9500 GOSUB 850: FOR I = 1 TO 7: PRINT : NEXT : INVERSE : PRINT "PLEASE WAIT";: NORMAL : PRINT "...": PRINT : PRINT SPC( 14);: RETURN
10000 DATA 15
10010 DATA DATE OF BIRTH,PLACE OF BIRTH,DATE OF DEATH/LIVING,PLACE OF DEATH/LIVING
10012 DATA MOTHER,FATHER,"SPOUSE(S)"
10015 DATA DATE(S) OF MARRIAGE,PLACE(S) OF MARRIAGE,MARITAL STATUS(ES),CHILDREN,NOTES,NUMBER OF MARRIAGES,NUMBER OF CHILDREN,NUMBER OF NOTES
10020 DATA 3
10030 DATA DATE OF BIRTH,DATE OF DEATH OR 'NOW',"FIRST VALID MARRIAGE DATE"
10040 DATA 4
10050 DATA MOTHER,FATHER,SPOUSES,"CHILDREN"
10060 DATA 5
10070 DATA PERFORM A SEARCH,OUTPUT SEARCH RESULT,CHANGE PROGRAM PARAMETERS,CHECK DISKETTES,EXIT PROGRAM
10075 DATA 3
10077 DATA OUTPUT TO SCREEN,OUTPUT TO PRINTER,OUTPUT TO DISKETTE
10080 DATA 3
10090 DATA SEARCH FOR DATE BETWEEN TWO YEARS,SEARCH FOR YEAR BETWEEN TWO DATES,SEARCH FOR APPEARANCES OF MONTH/DAY
10092 DATA 3
10093 DATA NUMBER OF MARRIAGES,NUMBER OF CHILDREN,NUMBER OF NOTES
10095 DATA 4
10096 DATA NUMBER RANGE,NUMBER LIST,NAME SET,LIST IN MEMORY
10097 DATA 5
10098 DATA SEARCH CHARACTER STRINGS,SEARCH DATES,SEARCH FOR NAMES,SEARCH FOR NUMBERS,"SEARCH FOR EMPTY FIELDS"
10100 DATA 7
10101 DATA TOP-OF-FORM AFTER PRINTS
10102 DATA SIZE OF LEFT MARGIN
10103 DATA USE LAST NAME FIRST
10104 DATA SHOW MARRIED NAME
10105 DATA TAB BEFORE HEADER
10106 DATA ASK FOR HEADER
10107 DATA IGNORE UPPER/LOWER CASE
11000 ONERR GOTO 11100
11010 PRINT CHR$(4)"OPEN CONFIGURATION": PRINT CHR$(4)"READ CONFIGURATION": FOR I = 1 TO 64: INPUT A: NEXT
11030 FOR I = 1 TO 40: INPUT A$: NEXT
11040 FOR I = 1 TO 17: INPUT A: NEXT : INPUT OP(1): INPUT OP(2): FOR I = 1 TO 4: INPUT OP(3): NEXT : INPUT A: INPUT A: INPUT A: FOR I = 4 TO 6: INPUT OP(I): NEXT
11045 FOR I = 1 TO 19: INPUT A: NEXT : FOR I = 7 TO 9: INPUT OP(I): NEXT
11050 PRINT CHR$(4)"CLOSE": POKE 216,0: RETURN
11100 A = PEEK(222): IF A = 5 OR A = 6 OR A = 8 THEN PRINT "NO CONFIGURATION FILE AVAILABLE ON": PRINT "DISKETTE LAST USED. PLEASE SEE MANUAL.": END
11110 PRINT "ERROR # "A". PLEASE SEE DOS MANUAL.": END
12000 GOSUB 11000: GOSUB 850: PRINT CHR$(4)"PR#"Q(43): IF Q(9) >0 THEN CALL G(0)
12030 READ A: FOR I = 1 TO A: READ S$(I,0): NEXT :S$(0,0) = STR$(A)
12040 READ A: FOR I = 1 TO A: READ S$(I,1): NEXT :S$(0,1) = STR$(A)
12050 READ A: FOR I = 1 TO A: READ VR$(I): NEXT :VR$(0) = STR$(A)
12060 READ CH: FOR I = 1 TO CH: READ H$(I): NEXT : GOSUB 7960
12065 READ A: FOR I = 1 TO A: READ S$(I,3): NEXT :S$(0,3) = STR$(A)
12070 READ A: FOR I = 1 TO A: READ CH$(I): NEXT :CH$(0) = STR$(A)
12080 READ A: FOR I = 1 TO A: READ WR$(I): NEXT :WR$(0) = STR$(A)
12085 READ H1: FOR I = 1 TO H1: READ H1$(I): NEXT
12087 READ A: FOR I = 1 TO A: READ S$(I,2): NEXT :S$(0,2) = STR$(A)
12088 B$ = "":A$ = "IS": IF Q(8) >1 THEN B$ = "S":A$ = "ARE"
12090 GOSUB 850
12110 R = 0: READ OP: FOR I = 1 TO OP: READ OP$(I): NEXT :OP(3) = LO: IF NOT Q(1) THEN OP(1) = 0